package com.booth.base.handlers;

import com.jfinal.handler.Handler;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ResourceHandler extends Handler
{
  private String constantName;
  private String constantVal;

  public ResourceHandler()
  {
  }

  public ResourceHandler(String constantName, String constantVal)
  {
    this.constantName = constantName;
    this.constantVal = constantVal;
  }

  public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled)
  {
    request.setAttribute(this.constantName, this.constantVal);
    this.nextHandler.handle(target, request, response, isHandled);
  }
}